package com.nbsaas.boot.store.rest.resource;

import com.nbsaas.boot.store.api.apis.StoreStaffApi;
import com.nbsaas.boot.store.data.entity.StoreStaff;
import com.nbsaas.boot.store.api.domain.request.StoreStaffRequest;
import com.nbsaas.boot.store.api.domain.response.StoreStaffResponse;
import com.nbsaas.boot.store.api.domain.simple.StoreStaffSimple;
import com.nbsaas.boot.store.rest.convert.StoreStaffSimpleConvert;
import com.nbsaas.boot.store.rest.convert.StoreStaffEntityConvert;
import com.nbsaas.boot.store.rest.convert.StoreStaffResponseConvert;
import com.nbsaas.boot.store.data.repository.StoreStaffRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   -业务接口实现
*/
@Transactional
@Service
public class StoreStaffResource extends BaseResource<StoreStaff,StoreStaffResponse, StoreStaffSimple, StoreStaffRequest>  implements StoreStaffApi {

    @Resource
    private StoreStaffRepository storeStaffRepository;

    @Override
    public JpaRepositoryImplementation<StoreStaff, Serializable> getJpaRepository() {
        return storeStaffRepository;
    }

    @Override
    public Function<StoreStaff, StoreStaffSimple> getConvertSimple() {
        return new StoreStaffSimpleConvert();
    }

    @Override
    public Function<StoreStaffRequest, StoreStaff> getConvertForm() {
        return new StoreStaffEntityConvert();
    }

    @Override
    public Function<StoreStaff, StoreStaffResponse> getConvertResponse() {
        return new StoreStaffResponseConvert();
    }




}


